"""app URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.urls import path
from . import views_login
from . import views_package
from . import views_member
from . import views_memberlevel
from . import views_requirement
from . import views_backuser
urlpatterns = []

# 服务包
urlpatterns += [
    path('package/add', views_package.PackageViewSet.as_view({"post": "package_add"}), name='package_add'),
    path('package/del', views_package.PackageViewSet.as_view({"post": "package_del"}), name='package_del'),
    path('package/mod', views_package.PackageViewSet.as_view({"post": "package_mod"}), name='package_mod'),
    path('package/one', views_package.PackageViewSet.as_view({"post": "package_one"}), name='package_one'),
    path('package/list', views_package.PackageViewSet.as_view({"post": "package_list"}), name='package_list'),
]

# 会员级别
urlpatterns += [
    path('memberlevel/add', views_memberlevel.MemberLevelViewSet.as_view({"post": "memberlevel_add"}), name='memberlevel_add'),
    path('memberlevel/del', views_memberlevel.MemberLevelViewSet.as_view({"post": "memberlevel_del"}), name='memberlevel_del'),
    path('memberlevel/mod', views_memberlevel.MemberLevelViewSet.as_view({"post": "memberlevel_mod"}), name='memberlevel_mod'),
    path('memberlevel/one', views_memberlevel.MemberLevelViewSet.as_view({"post": "memberlevel_one"}), name='memberlevel_one'),
    path('memberlevel/list', views_memberlevel.MemberLevelViewSet.as_view({"post": "memberlevel_list"}), name='memberlevel_list'),
]

# 用户级别所拥有的资源(图片pic/音乐audio/视频video)
urlpatterns += [
    path('member2material/bind', views_memberlevel.Level2MaterialViewSet.as_view({"post": "level2material_bind"}), name='level2material_bind'),
    path('member2material/unbind', views_memberlevel.Level2MaterialViewSet.as_view({"post": "level2material_unbind"}), name='level2material_unbind'),
    path('member2material/unbind_onetype', views_memberlevel.Level2MaterialViewSet.as_view({"post": "level2material_unbind_onetype"}), name='level2material_unbind_onetype'),
    path('member2material/list', views_memberlevel.Level2MaterialViewSet.as_view({"post": "level2material_list"}), name='level2material_list'),
]


# 需求
urlpatterns += [
    path('requirement/add', views_requirement.RequirementViewSet.as_view({"post": "requirement_add"}), name='requirement_add'),
    path('requirement/del', views_requirement.RequirementViewSet.as_view({"post": "requirement_del"}), name='requirement_del'),
    path('requirement/mod', views_requirement.RequirementViewSet.as_view({"post": "requirement_mod"}), name='requirement_mod'),
    path('requirement/one', views_requirement.RequirementViewSet.as_view({"post": "requirement_one"}), name='requirement_one'),
    path('requirement/list', views_requirement.RequirementViewSet.as_view({"post": "requirement_list"}), name='requirement_list'),
]


# 会员
urlpatterns += [
    path('member/add', views_member.MemberViewSet.as_view({"post": "member_add"}), name='member_add'),
    path('member/del', views_member.MemberViewSet.as_view({"post": "member_del"}), name='member_del'),
    path('member/mod', views_member.MemberViewSet.as_view({"post": "member_mod"}), name='member_mod'),
    path('member/one', views_member.MemberViewSet.as_view({"post": "member_one"}), name='member_one'),
    path('member/list', views_member.MemberViewSet.as_view({"post": "member_list"}), name='member_list'),
]
# 会员登录
urlpatterns += [
    path('member/login', views_login.MemberLoginViewSet.as_view({"post": "member_login"}), name='member_login'),
    path('member/phonelogin', views_login.MemberLoginViewSet.as_view({"post": "member_phone_login"}), name='member_phone_login'),
    path('member/qqlogin', views_login.MemberLoginViewSet.as_view({"post": "member_qq_after_login"}), name='member_qq_after_login'),
    path('member/wechatlogin', views_login.MemberLoginViewSet.as_view({"post": "member_wechat_login"}), name='member_wechat_login'),

]

urlpatterns += [
    path('user/add', views_backuser.BackUserViewSet.as_view({"post": "backuser_add"}), name='backuser_add'),
    path('user/del', views_backuser.BackUserViewSet.as_view({"post": "backuser_del"}), name='backuser_del'),
    path('user/mod', views_backuser.BackUserViewSet.as_view({"post": "backuser_mod"}), name='backuser_mod'),
    path('user/one', views_backuser.BackUserViewSet.as_view({"post": "backuser_one"}), name='backuser_one'),
    path('user/list', views_backuser.BackUserViewSet.as_view({"post": "backuser_list"}), name='backuser_list'),
]

# 用户登录
urlpatterns += [
    path('user/login', views_login.UserLoginViewSet.as_view({"post": "user_login"}), name='user_login'),
    path('user/info', views_login.UserLoginViewSet.as_view({"post": "user_info"}), name='user_info'),
    path('user/phonelogin', views_login.UserLoginViewSet.as_view({"post": "user_phone_login"}), name='user_phone_login'),
    # path('user/qqlogin', views_login.UserLoginViewSet.as_view({"post": "user_qq_login"}), name='user_qq_login'),
    # path('user/wechatlogin', views_login.UserLoginViewSet.as_view({"post": "user_wechat_login"}), name='user_wechat_login'),
]



